<?php
App::uses('AuthComponent', 'Controller/Component');
class User extends AppModel {
    public $helpers = array('Html', 'Form');
    public $actsAs = array(
        'Captcha' => array(
            'field' => 'captcha',
            'error' => 'Captcha code entered invalid'
        )
    );
    public $uses=array('User','Order','Ticket','Webhosting');
    public $hasMany = array(
        'Order' => array(
            'className' => 'Order',
            'foreignKey' => 'userid',
        ),
        /*'Ticket' => array(
            'className' => 'Ticket',
            'foreignKey' => 'userid',
        ) */
    );
    public $displayField = 'login';
    //public $components = array('Session','Auth');
    public $validate = array(
        'login' => array(
            'required' => array(
                'rule' => array('notEmpty'),
                'message' => 'A login is required',
                'minLength', 2
            )
        ),
        'email' => 'email',
        'password' => array(
            'required' => array(
                'rule' => array('notEmpty'),
                'message' => 'A password is required',
                'minLength', 4,
                'on' => 'create'
            )
        ),
        'confirmpassword' => array(
            'required' => array(
                'rule' => array('notEmpty'),
                'message' => 'A password is required',
                'minLength', 4,
                'on' => 'create'
            )
        )
    );
}


?>